package com.ziki.test.jni;

public class Sysinfo {
    public static native double getCpuUsage();
    
    public static native long getMemoryUsage();
    
    static {
        System.out.println(System.getProperty("java.library.path"));  
        System.loadLibrary("Sysinfo");
    }
    
    public static void main(String[] args) {
        // Sysinfo info = new Sysinfo();
        System.out.println("CPU的使用率:" + getCpuUsage() + "%");
        System.out.println("内存的使用率:" + getMemoryUsage() + "%");
    }
}
